package trial.bishi2023;

import java.util.Arrays;
import java.util.Scanner;

public class LianTong {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int a, b;
        String input = cin.nextLine();
        String[] nums= input.split(",");
        a = Integer.parseInt(nums[0]);
        b = Integer.parseInt(nums[1]);
        long ans = 0L;
        for (int i = 0; i < b; i++) {
            ans += num(i+1, a);
        }
        System.out.println(ans);
    }

    public static long num(int i, int num) {
//        System.out.println(String.valueOf(num).repeat(i));
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(num);
        }
        System.out.println(Long.parseLong(sb.toString()));
        return Long.parseLong(sb.toString());
    }
}
